
import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

public class DrawingArea extends JPanel{
	
	private Symbol state;
	
	public DrawingArea(){
		
		this.addMouseListener(new DrawSymbol());
	}
	
	public void setSymbol(Symbol s){
		
		this.state = s;
	}
	
	public void drawSymbol(MouseEvent event){
		
		if(state == null)
		 return;
			
		this.setLayout(null);
		JPanel panel = state.getSymbolPanel();
		
		
		panel.setBounds(event.getX(), event.getY(),200,200);
			
		this.add(panel);
		panel.repaint();
		state = null;
	}
	
	private class DrawSymbol implements MouseListener{

		@Override
		public void mouseClicked(MouseEvent arg0) {
			DrawingArea.this.drawSymbol(arg0);
		}

		@Override
		public void mouseEntered(MouseEvent arg0) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void mouseExited(MouseEvent arg0) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void mousePressed(MouseEvent arg0) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void mouseReleased(MouseEvent arg0) {
			// TODO Auto-generated method stub
			
		}
		
	}
}